using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using QuanLyNhaSach.QuanLyNhaSachDTO;
using QuanLyNhaSach.QuanLyNhaSachDao;
using QuanLyNhaSach.QuanLyNhaSachBus;

namespace QuanLyNhaSach.DanhSachForm
{
    public partial class frmTraCuuKhachHang : DevComponents.DotNetBar.Office2007Form
    {
        public string ThongTinNhap;
        public frmTraCuuKhachHang()
        {
            InitializeComponent();
        }
        private void btn_Thoat_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_Tim_Click(object sender, EventArgs e)
        {
            DataTable dt;
            ThongTinNhap = txt_ThongTin.Text.Trim();
            if (rd_tenkhachhang.Checked)
            {
                dt = KhachHangBus.KhachHangTraCuuTen(ThongTinNhap);
                grid_view.DataSource = dt;
                return;
            }
            if (rd_diachi.Checked)
            {
                dt = KhachHangBus.KhachHangTraCuuDiaChi(ThongTinNhap);
                grid_view.DataSource = dt;
                return;
            }
            if (rd_dienthoai.Checked)
            {
                dt = KhachHangBus.KhachHangTraCuuDienThoai(ThongTinNhap);
                grid_view.DataSource = dt;
                return;
            }
            if (rd_Email.Checked)
            {
                dt = KhachHangBus.KhachHangTraCuuEmail(ThongTinNhap);
                grid_view.DataSource = dt;
                return;
            }
            if (rd_TienNo.Checked)
            {
                dt = KhachHangBus.KhachHangTraCuuTienNo(ThongTinNhap);
                grid_view.DataSource = dt;
                return;
            }
            else
            {
                dt = KhachHangBus.GetKhachHangAll();
                grid_view.DataSource = dt;
            }
        }
    }
}